<script type="text/javascript">
	$(document).ready(function () {

		//Default Action
		$(".tab_content").hide(); //Hide all content
		$("ul.tabs li:first").addClass("active").show(); //Activate first tab
		$(".tab_content:first").show(); //Show first tab content

		//On Click Event
		$("ul.tabs li").click(function () {
			$("ul.tabs li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".tab_content").hide(); //Hide all tab content
			var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active content
			return false;
		});

	});
</script>
<?php 
$sanpham = $ado->getDetailSP($idSP);
$row_ct = mysql_fetch_assoc($sanpham);
?>
        <div class="sp">
            <div class="sp_title">
                <span>Tính năng nổi bật</span></div>
            <div class="txt_nd ClearItems">
                <div class="pro_details">
                    <div class="img_prodetails">
                        <img width="255" id="cphBody_imgDetail" src="<?php echo str_replace('../','',$row_ct['UrlHinh']); ?>"></div>
                    <div class="tb_detail bgtbinfo">
                        <table width="250" cellspacing="1" cellpadding="0" border="0">
                            <tbody><tr>
                                <td class="bgtbinfo1" colspan="2">
                                    <strong class="redtext">
                                        <?php echo $row_ct['MaSP']?></strong>
                                </td>
                            </tr>
                            <tr>
                                <td width="98" class="bgtbinfo2">
                                    <strong>Giá</strong>
                                </td>
                                <td width="299" class="bgtbinfo1">
                                    <strong class="redtext">
                                        <?php echo number_format($row_ct['Gia']);?>
                                        VNĐ</strong>
                                </td>
                            </tr>
                            <tr>
                                <td class="bgtbinfo2">
                                    <strong>Hãng</strong>
                                </td>
                                <td class="bgtbinfo1">
                                    <?php echo $row_ct['TenLT']?>
                                </td>
                            </tr>
                            <tr>
                                <td class="bgtbinfo2">
                                    <strong>Bảo hành</strong>
                                </td>
                                <td class="bgtbinfo1">
                                   <?php echo $row_ct['BaoHanh']?>
                                </td>
                            </tr>                            
                        </tbody></table>
                    </div>
                </div>
                <br class="ClearItems">
                <div class="container">
                    <ul class="tabs">
                        <li class="etab"><a href="#tab1">Tính năng</a></li>
                        <li><a href="#tab2">Mô tả kỹ thuật</a></li>
                       <li><a href="#tab3">Hình ảnh</a></li>
                    </ul>
                    <div class="tab_container">
                        <div class="tab_content" id="tab1" style="display: none;">
                            <?php echo $row_ct['TinhNang']; ?>
                        </div>
                        <div class="tab_content" id="tab2" style="display: block;">
                            <?php echo $row_ct['MoTa']; ?>
                        </div>  
                        <div class="tab_content" id="tab3" style="display: block;">
                            <?php 
							$sql_image = "SELECT * FROM hinhsp WHERE idSP = $idSP ";
							$rs_hinh = mysql_query($sql_image);
							while($row_hinh = mysql_fetch_assoc($rs_hinh)){
							?>	
								<img src="<?php echo $row_hinh['url'];?>" width="450" /><br />
							<?php 
								}
							?>
                        </div>                      
                    </div>
                </div>
            </div>
        </div>
        <div class="sp">
            <div class="sp_title">
                <span>sản phẩm Cùng loại</span></div>
            <div class="allpro">
                
                         <?php 
						$cungloai = $ado->SanPham_CungLoai($row_ct['idTL'],$idSP,4,0);
						while($row = mysql_fetch_assoc($cungloai)){
						?>              
							<div class="viewpro">
								<div class="imgview">
									<a href="detail/<?php echo $row['MaSP_KD']."-".$row['idSP']; ?>.html" title="<?php echo $row['MaSP']?>">
										<img src="<?php echo str_replace('../','',$row['UrlHinh']); ?>" alt="<?php echo $row['MaSP']?>" title="<?php echo $row['MaSP']?>" height="100" width="140">
									 </a>
								</div>
								<div class="tit_pro">
									<a href="detail/<?php echo $row['MaSP_KD']."-".$row['idSP']; ?>.html" title="<?php echo $row['MaSP']?>"><?php echo $row['MaSP']?></a>
								</div>
								<div class="nd_pro">Giá: <span style="color:red"><?php echo number_format($row['Gia']);?></span> VNĐ<br>Xuất xứ: <?php echo $row['XuatXu']?></div>
								<div class="xemtiep1">
									<a href="detail/<?php echo $row['MaSP_KD']."-".$row['idSP']; ?>.html" title="<?php echo $row['MaSP']?>">Chi tiết</a>
									<img src="static/icon_more.gif" alt="" height="7" width="7">
								</div>
							</div>
						<?php } ?>
                    
            </div>
        </div>
        
